import 'package:fish_redux/fish_redux.dart';
import 'package:flutter_work/list/component/state.dart';

class ListPageState extends MutableSource implements Cloneable<ListPageState> {

  List<ItemComponentState>datas;

  @override
  ListPageState clone() {
    return ListPageState()
      ..datas = datas;
  }

  @override
  Object getItemData(int index) =>datas[index];

  @override
  String getItemType(int index) =>'item';

  @override
  int get itemCount => datas?.length??0;

  @override
  void setItemData(int index, Object data) =>datas[index]=data;
}

ListPageState initState(Map<String, dynamic> args) {
  return ListPageState()
    ..datas = <ItemComponentState>[];
}

